﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Linq.Expressions;

using Mvc.XForms.Utilities;

namespace Mvc.XForms.Actions.Settings {
	public class ActionDeleteSettings<TContext> {
		private IActionDelete<TContext> action;

		public ActionDeleteSettings(IActionDelete<TContext> action) {
			this.action = action;
		}

		public ActionDeleteSettings<TContext> Nodeset<T>(Expression<Func<TContext, IList<T>>> nodeset) {
			action.Nodeset = nodeset.Body.ExtractID();
			return this;
		}

		public ActionDeleteSettings<TContext> If(string scriptFunction) {
			action.If = scriptFunction;
			return this;
		}
	}
}
